<?php
function getStreetNoFromAddress($address){
    $array=explode(",",$address);
    if(is_numeric($array[0][0])){
	return $array[0];
    }
    return "";
}
function getStreetFromAddress(){
    $array=explode(",",$address);
    if(is_numeric($array[0][0])){
	return str_replace($array[0]." ","",$address);
    }
    return $address;
}
function CalcLivingExpensesPayment($p1,$p2){
    $p1 += round($p2/12);
    return $p1;
}
function getGender($t){
	if($t=="Mr")
		return "Male";
	else if($t=="Ms" || $t=="Miss" || $t=="Mrs")
		return "Female";
	else 
		return "Unknown";
}
function cleanStr($str){
    return str_replace("'", "", $str);
}
function toNum($num)
{
	$num=str_replace( array('$',','),'', $num );
	return $num;
}	
function expCal($v, $p){
	if($p == 'Weekly')
		$p = 52/12;
	if($p == 'Fortnightly')
		$p = 26/12;
	if($p == 'Monthly')
		$p = 1;
	return round($v*$p);
}
